<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Tim —— 纺织品贸易信息管理系统 </title>
<link type="text/css" rel="stylesheet" href="${base}/static/css/ext-all.css" />
<script type="text/javascript" src="${base}/dwr/engine.js"></script>
<script type="text/javascript" src="${base}/dwr/util.js"></script>
<script type="text/javascript" src="${base}/dwr/interface/staffService.js"></script>
<script type="text/javascript" src="${base}/static/js/ext-base.js"></script>
<script type="text/javascript" src="${base}/static/js/ext-all.js"></script>
<script type="text/javascript">
	Ext.BLANK_IMAGE_URL = '${base}/static/images/default/s.gif'; // 避免线上访问extjs.com而做的特殊处理
	Ext.QuickTips.init();
	Ext.onReady(function(){
		var loginForm = new Ext.form.FormPanel({
			id: 'logonFormPanel',
		 	title: '请登录 ...',
			height: 170,
			width: 300,
			frame: true,
			monitorValid:true,
			applyTo: 'form',
			labelSeparator: '：',
			labelWidth: 60,
			labelAlign: 'right',
			items: [
				 new Ext.form.TextField({
				 	id: 'logonId',
				 	name: 'username',
				 	fieldLabel : '登录名',
				 	allowBlank: false,
				 	blankText: '请输入登录名',
				 	tabIndex: 1,
				 	msgTarget: 'qtip'
				 }),
				 new Ext.form.TextField({
				 	id: 'logonPass',
				 	name: 'password',
				 	allowBlank: false,
				 	blankText: '请输入口令',
				 	fieldLabel: '口  令',
				 	tabIndex: 2,
				 	inputType: 'password',
				 	msgTarget: 'qtip'
				 })
			],
			buttons: [
				new Ext.Button({text: '提交', type:'button', handler: doLogin, formBind:true, arrowAlign: 'bottom'}),
				new Ext.Button({text: '重置', type:'reset', handler: doReset, arrowAlign: 'bottom'})
			]
		 })
		 
		 /**
		  * 登录按钮触发事件
		  */
		 function doLogin(){
		 	loginForm.form.submit({
		 		clientValidation: true,
		 		waitMsg: '正在登录，请稍候....',
		 		waitTitle: '提示',
		 		url: '${base}/doLogin.action',
		 		method: 'POST',
		 		success: function(form,action){document.location.href = "${base}/index.action";},
		 		failure: function(form,action){
							Ext.Msg.alert('提示','系统登录失败，原因：'+ action.result.error, loginForm.form.reset(), null );
		 				}
		 	});
		 }
		 
		 /**
		  * 重置按钮触发事件
		  */
		 function doReset(){
			loginForm.form.reset();
		 }
	});
</script>
</head>
<body>
<div id="form"></div>
</body>
</html>